using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class employer_Default2 : System.Web.UI.Page
{
    ThucDon TD = new ThucDon();
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        //{
            BinDataToGrid();
        //}
    }

    public void BinDataToGrid()
    {
        DataTable table = TD.GetAllFood();

        ViewState["FastFood"] = table;
        GridView1.DataSource = table;
        GridView1.DataBind();
    }

    private DataTable ShoppingCartList
    {
        get
        {
            DataTable table = ViewState["FastFood"] as DataTable;
            if (table != null)
            {
                return table;
            }
            else
            {
                return new DataTable();
            }
        }
    }

    protected void btnUpdate_Click(object sender, EventArgs e)
    {

    }

    protected void grdProducts_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        GridView1.PageIndex = e.NewSelectedIndex;
        GridView1.DataSource = ShoppingCartList;
        GridView1.DataBind();
    }
    protected void grdProducts_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("Delete"))
        {
            int id = Convert.ToInt32(e.CommandArgument);
            //    account.userid = id;
            //    account.active_unactive();

        }
    }
    protected void Button3_Click(object sender, EventArgs e)
    {

    }
}
